using System;
using System.Collections.Generic;
using System.Text;

using csammisrun.utility;
using csammisrun.MsnLib.Utility;

namespace csammisrun.MsnLib
{
  /// <summary>
  /// A chatroom contains one or more users to converse with
  /// </summary>
  public class ChatRoom
  {
    private Switchboard _sb = null;

    public ChatRoom(Switchboard switchboard)
    {
      if (switchboard.SubType != SwitchboardSubType.ChatRoom)
      {
        throw new ArgumentException("Switchboard must have subtype ChatRoom", "switchboard");
      }

      _sb = switchboard;
    }

    /// <summary>
    /// Gets the <see cref="Switchboard"/> backing the chatroom
    /// </summary>
    internal Switchboard Switchboard
    {
      get { return _sb; }
    }

    /// <summary>
    /// Gets a list of users in the chat
    /// </summary>
    public List<User> Users
    {
      get { return _sb.Participants; }
    }
  }
}
